import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/emergency/communication_personnel_entity.dart';
import 'package:enterprise_v6_app/app/data/common/tree_node_child_bean.dart';


CommunicationPersonnelEntity $CommunicationPersonnelEntityFromJson(Map<String, dynamic> json) {
  final CommunicationPersonnelEntity communicationPersonnelEntity = CommunicationPersonnelEntity();
  final String? communicationId = jsonConvert.convert<String>(json['communicationId']);
  if (communicationId != null) {
    communicationPersonnelEntity.communicationId = communicationId;
  }
  final String? communicationName = jsonConvert.convert<String>(json['communicationName']);
  if (communicationName != null) {
    communicationPersonnelEntity.communicationName = communicationName;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    communicationPersonnelEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    communicationPersonnelEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    communicationPersonnelEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    communicationPersonnelEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    communicationPersonnelEntity.deleted = deleted;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    communicationPersonnelEntity.id = id;
  }
  final String? phone = jsonConvert.convert<String>(json['phone']);
  if (phone != null) {
    communicationPersonnelEntity.phone = phone;
  }
  final String? postName = jsonConvert.convert<String>(json['postName']);
  if (postName != null) {
    communicationPersonnelEntity.postName = postName;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    communicationPersonnelEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    communicationPersonnelEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    communicationPersonnelEntity.updateDate = updateDate;
  }
  final String? userName = jsonConvert.convert<String>(json['userName']);
  if (userName != null) {
    communicationPersonnelEntity.userName = userName;
  }
  final bool? isSelected = jsonConvert.convert<bool>(json['isSelected']);
  if (isSelected != null) {
    communicationPersonnelEntity.isSelected = isSelected;
  }
  return communicationPersonnelEntity;
}

Map<String, dynamic> $CommunicationPersonnelEntityToJson(CommunicationPersonnelEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['communicationId'] = entity.communicationId;
  data['communicationName'] = entity.communicationName;
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['id'] = entity.id;
  data['phone'] = entity.phone;
  data['postName'] = entity.postName;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['userName'] = entity.userName;
  data['isSelected'] = entity.isSelected;
  return data;
}

extension CommunicationPersonnelEntityExtension on CommunicationPersonnelEntity {
  CommunicationPersonnelEntity copyWith({
    String? communicationId,
    String? communicationName,
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? id,
    String? phone,
    String? postName,
    String? updateBy,
    String? updateById,
    String? updateDate,
    String? userName,
    bool? isSelected,
  }) {
    return CommunicationPersonnelEntity()
      ..communicationId = communicationId ?? this.communicationId
      ..communicationName = communicationName ?? this.communicationName
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..id = id ?? this.id
      ..phone = phone ?? this.phone
      ..postName = postName ?? this.postName
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..userName = userName ?? this.userName
      ..isSelected = isSelected ?? this.isSelected;
  }
}
